from django.conf.urls.defaults import *
from django.contrib import admin
from django.views.generic import DetailView, ListView
from wikiproduct.models import Product
admin.autodiscover()

handler500 = 'djangotoolbox.errorviews.server_error'

urlpatterns = patterns('',
#    (r'^$',                 
#        ListView.as_view(
#            queryset=Product.objects.filter(deleted=False)[:5],
#            context_object_name='latest_product_list',
#            template_name='products/index.html')),
    (r'^products/(?P<pk>[A-Za-z0-9-_]+)/$',
       DetailView.as_view(
           model=Product,
           template_name='products/detail.html')),
           
    (r'^$', 'wikiproduct.views.index'),
#    (r'^products/(?P<product_id>\d+)/$', 'wikiproduct.views.detail'),   
#    (r'^image/$', 'wikiproduct.views.upload_handler'),
    (r'^i18n/', include('django.conf.urls.i18n')),
    (r'^files$', 'wikiproduct.views.upload_handler'),
    (r'^download/(?P<pk>.+)$', 'wikiproduct.views.download_handler'),
    (r'^delete/(?P<pk>.+)$', 'wikiproduct.views.delete_handler'),
    
    
    ('^_ah/warmup$', 'djangoappengine.views.warmup'),
   # ('^$', 'django.views.generic.simple.direct_to_template',
  #  {'template': 'home.html'}),
    (r'^admin/', include(admin.site.urls)),
)


